<template>
  <div class="header">
    <div class="title">云课在线考试后台管理系统</div>
    <div class="logout">
      <!-- <i class="el-icon-caret-bottom"></i> -->
      <el-menu
        :default-active="activeIndex"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
      >
        <el-submenu index="1">
          <template slot="title">操作</template>
          <el-menu-item index="2-1" @click="logout">退出登录</el-menu-item>
        </el-submenu>
      </el-menu>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      activeIndex:'1'
    }
  },
  methods:{
    logout(){
      this.$cookies.remove("token");
      localStorage.clear()
      this.$router.push('/adminLogin')
    }
  }
};
</script>

<style lang="less" scoped>
.header {
  .title {
    font-size: 22px;
    width: 80%;
    line-height: 60px;
  }
  .logout {
    font-size: 25px;
  }
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>